﻿using System.Collections.Generic;

namespace WebAppDemo.Classes
{
    public class MyContext
    {
        private static MyContext _context;
        private MyContext()
        {
        }

        public static MyContext GetInstance()
        {
            if (_context == null)
            {
                lock (typeof(MyContext))
                {
                    _context = new MyContext();

                }
            }
            return _context;
        }

        private List<Person> _persons;
        public List<Person> Persons
        {
            get { return _persons ?? new List<Person>(); }
        }
    }
}
